package com.dy.design_pattern_study.command_pattern.dome2;

import com.dy.design_pattern_study.command_pattern.dome2.impl.BakeChickenWingCommand;
import com.dy.design_pattern_study.command_pattern.dome2.impl.BakeMuttonCommand;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-19
 * @Content
 */
public class client {
    public static void main(String[] args) {
        //准备大厨和服务员
        Barbecuer boy = new Barbecuer();
        Command bakeMuttonCommand1 = new BakeMuttonCommand(boy);
        Command bakeMuttonCommand2 = new BakeMuttonCommand(boy);
        Command bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
        Waiter girl = new Waiter();

        girl.setOrder(bakeMuttonCommand1);
        girl.setOrder(bakeMuttonCommand2);
        girl.setOrder(bakeChickenWingCommand1);

        girl.notifyMethod();

        girl.cancelOrder(bakeMuttonCommand1);
        girl.notifyMethod();

        //firstClient();

    }

    /**
     * 第一版简单服务员
     */
    private static void firstClient() {
        //准备大厨和服务员
        Barbecuer boy = new Barbecuer();
        Command bakeMuttonCommand1 = new BakeMuttonCommand(boy);
        Command bakeMuttonCommand2 = new BakeMuttonCommand(boy);
        Command bakeChickenWingCommand1 = new BakeChickenWingCommand(boy);
        WaiterFirst girl = new WaiterFirst();

        //开门
        //服务员根据客户的不同需求通知大厨进行制作
        girl.setOrder(bakeMuttonCommand1);
        girl.notifyMethod();
        girl.setOrder(bakeMuttonCommand2);
        girl.notifyMethod();
        girl.setOrder(bakeChickenWingCommand1);
        girl.notifyMethod();
    }
}
